svencoopediafandomcom-20200213-history
Trigger Changevalue
trigger_changevalue is an entity in Sven Co-op that allows the mapper to change the keyvalues of a target entity. It allows the use of arithmetic operations on a keyvalue. '' { "classname" "trigger_changevalue" "targetname" "target_me" "target" "" "m_iszValueName" "" "m_iszNewValue" "v" "m_iszValueType" "r" "spawnflags" "s" } '' Attributes * Destination Entity- "target" "" '': This sets the target entity to which to apply the value change to. The target entity's targetname will go here. * '''Destination Keyvalue'- "m_iszValueName" "" '': Sets the target entity's specified key to change the value of. * '''Static source-value'- "m_iszNewValue" "v" '': The value v that is used to perform the changevalue. If there is no valuetype set, the number v will simply overwrite the old keyvalue with ''v (because the engine assumes the default m_iszValueType to be "0"). * Operation "m_iszValueType" "r" '': If ''r is set to preset values it will use the Static source-value v'' to perform the corresponding operation : 0 : "Replace (= source)" 1 : "Add (= old + source)" 2 : "Mul (= old * source)" 3 : "Sub (= old - source)" 4 : "Div (= old / source)" 16 : "Pow (= old ^ source)" 12 : "Mod (= old % source)" 5 : "AND (= old & source)" 6 : "OR (= old | source)" 13 : "XOR (= old ^ source)" 7 : "NAND (= !(old & source))" 8 : "NOR (= !(old | source))" 14 : "NXOR (= !(old ^ source))" 11 : "Append (String concatenation)" 17 : "Sin (= sin(source))" 18 : "Cos (= cos(source))" 19 : "Tan (= tan(source))" 23 : "Cot (= cot(source))" 20 : "Arcsin (= arcsin(source))" 21 : "Arccos (= arccos(source))" 22 : "Arctan (= arctan(source))" 24 : "Arccot (= arccot(source))" * '''Trigger after operation'- "message" "": After the changevalue is successful this will allow the entity to trigger something else. The target entity name must be set. Flags "spawnflags" "s", when s'' equals: * '''1 '- Don't use X : When using vectors/arrays, this will ignore the first array. E.g., when setting render-color, specifying this flag would ignore the 'Red'-value. * 2 '''- '''Don't use Y : When using vectors/arrays, this will ignore the second array. E.g., when setting angles, specifying this flag would ignore the 'Yaw'-value. * 4 '''- '''Don't use Z : When using vectors/arrays, this will ignore the third array. E.g., when setting velocity, specifying this flag would ignore the vertical velocity. * 32 '''- '''Invert target value : The destination keyvalue will be multiplied with minus one before proceeding. * 64 '''- '''Invert source value : The source-value will be multiplied with minus one before proceeding; this change is only temporary and this keyvalue is rather useless, as you can always prepend a minus-sign to the static source-value. Notes * trigger_changevalue supports the use of "!activator" and "!caller" in the "Destination Entity"-field. * Trying to write a vector to a float or integer will cause the vector's length to be written. This is in respect to any ignored dimensions as per spawnflags. References * Sven Manor- trigger_changevalue https://sites.google.com/site/svenmanor/entguide/trigger_changevalue Category:Entities __FORCETOC__